//
//  PKConfigUtils.swift
//  Panku
//
//  Created by mac on 2017/2/8.
//  Copyright © 2017年 Monster. All rights reserved.
//

import UIKit

class PKConfigUtils: NSObject {
    
    //根据返回类型 设置type泛型
    class func stringForKey(key:String) -> String{
        
        //获取config.plist文件路径
        let configPlistPath = Bundle.main.path(forResource: "config", ofType: "plist")
        
        guard configPlistPath != nil else {
            assert(true, "找不到config.plist文件，请在项目中添加config.plist文件")
            return ""
        }
        
        //获取根字典
        let dict = NSDictionary(contentsOfFile: configPlistPath!)
        
        //根据key返回对应的value
        return dict!.stringValue(forKey: key, default: "")!
    }
}
